package org.kfive.nova.test.gc;

/**
 * Created with IntelliJ IDEA.
 * User: admin
 * Date: 16-6-5
 * Time: 上午11:49
 * To change this template use File | Settings | File Templates.
 * -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:D:/log/gc.log -Xms20M -Xmx20M -Xmn10M -XX:SurvivorRatio=8 -verbose:gc
 *
 */
public class EdenAllocation {

    private static final int _1MB = 1024*1024;

    public static void main(String[] args) {

        byte [] allocation1,allocation2,allocation3,allocation4;
        allocation1 = new byte[_1MB*4];
        allocation2 = new byte[_1MB*4];
        //新生代内存不足，出发MinorGC
        //现有allocation1、allocation2共8M,Survivor共1M无法放下
        //将其移入老年代，并在新生代分配allocation3
        allocation3 = new byte[_1MB*4];
    }
}
